<html>
<head><meta charset="utf-8"><title>debugging tools for dataflow and mir opts · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/debugging.20tools.20for.20dataflow.20and.20mir.20opts.html">debugging tools for dataflow and mir opts</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="245849268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/debugging%20tools%20for%20dataflow%20and%20mir%20opts/near/245849268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/debugging.20tools.20for.20dataflow.20and.20mir.20opts.html#245849268">(Jul 13 2021 at 16:19)</a>:</h4>
<p>It is often rather hard to reason about the various state changes during a mir opt's operation. Some mir opts are using debug printing, some have more complex debugging systems, others have none. I thing we should figure out a generic framework that allows inspecting the mir opt state without having to modify the mir opt's source all the time. There should also be some connection between the state and the original source code and the mir statement that is being processed. I have no real clue how this would look, but I think we should have something in this space. A good starting example could be <a href="https://github.com/rust-lang/rust-clippy/pull/7346#issuecomment-878237257">clippy's clone lint</a>, which isn't complex per se, but it can still be hard to figure out what's going on in more complex examples</p>



<a name="245862427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/debugging%20tools%20for%20dataflow%20and%20mir%20opts/near/245862427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/debugging.20tools.20for.20dataflow.20and.20mir.20opts.html#245862427">(Jul 13 2021 at 17:54)</a>:</h4>
<p>Semi-related, having optimization remarks that can be embedded in the MIR dump would also be helpful. I know LLVM has a relatively complex framework for recording these including an HTML based viewer but even something simple like adding extra comments to the MIR output would be nice.</p>



<a name="245866464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/debugging%20tools%20for%20dataflow%20and%20mir%20opts/near/245866464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/debugging.20tools.20for.20dataflow.20and.20mir.20opts.html#245866464">(Jul 13 2021 at 18:22)</a>:</h4>
<p>cg_clif has a method to add arbitrary comments to generated clif ir text files. It is pretty useful to me. <a href="https://github.com/bjorn3/rustc_codegen_cranelift/blob/ab4da1174c9bc85e85c7348576f913327ebc9f0d/src/pretty_clif.rs">https://github.com/bjorn3/rustc_codegen_cranelift/blob/ab4da1174c9bc85e85c7348576f913327ebc9f0d/src/pretty_clif.rs</a></p>



<a name="245920731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/debugging%20tools%20for%20dataflow%20and%20mir%20opts/near/245920731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Vandel Sillesen <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/debugging.20tools.20for.20dataflow.20and.20mir.20opts.html#245920731">(Jul 14 2021 at 05:23)</a>:</h4>
<p>Maybe out of scope, but this seems related to adding metadata like range information to e.g locals</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>